package com.wn.prodmanagement.mapper;

import com.wn.entity.MaterialApplication;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @program: pms
 * @InterfaceName MaterialApplicationMapper
 * @description:领料申请
 * @author: LRW
 * @create: 2022-10-26 20:43
 * @Version 1.0
 **/
public interface MaterialApplicationMapper {

    @Insert("insert into pms_material_req(no,applicant,inventory_bookkeeping_id,quantity,time,description,workorder_id,activiti_instance_id) values(#{no},#{applicant.id},#{inventoryBookkeepingId.id},#{quantity},#{time},#{description},#{workOrderId.id},#{activitiInstanceId})")
    void add(MaterialApplication materialApplication);

    @Select("select * from pms_material_req where id=#{id}")
    MaterialApplication selectById(int id);

    List<MaterialApplication> selectByCondition(MaterialApplication materialApplication);

}
